-- @Author: baidwwy
-- @Date:   2023-09-12 12:13:54
-- @Last Modified by:   baidwwy
-- @Last Modified time: 2023-12-19 13:21:28
--======================================================================--
-- @作者: GGE研究群: 342119466
-- @创建时间:   2018-03-03 02:34:19
-- @Last Modified time: 2023-05-13 19:08:56
--======================================================================--
local 内存类_物品 = class()
local ceil = math.ceil

local floor = math.floor
local typ = type
local random = 引擎.取随机整数
local 五行_ = {"金","木","水","火","土"}

local function 变身卡(模型)
	if 模型 == "大海龟" then
		return "大海龟","item.wdf",0x4A028BEE,0x3C7B89E8,nil,nil,20,1,3
	elseif 模型 == "巨蛙" then
		return "巨蛙","item.wdf",0x4A028BEE,0x98E3377F,nil,nil,20,1,3
	elseif 模型 == "海星" then
		return "海星","item.wd1",1241680878,3876179373,nil,nil,20,1,3,"item.wdf"
	elseif 模型 == "章鱼" then
		return "章鱼","item.wd1",1241680878,2880866697,nil,nil,20,1,3,"item.wdf"
	elseif 模型 == "狸" then
		return "狸","item.wd1",1241680878,2785980633,nil,nil,20,1,3,"item.wdf"
	elseif 模型 == "大蝙蝠" then
		return "大蝙蝠","item.wdf",1241680878,0x2481DFCC,nil,nil,20,1,3
	elseif 模型 == "赌徒" then
		return "赌徒","item.wdf",1241680878,0x6BE81A68,nil,nil,20,1,3
	elseif 模型 == "海毛虫" then
		return "海毛虫","item.wdf",1241680878,0x3BD0B554,nil,nil,20,1,3
	elseif 模型 == "护卫" then
		return "护卫","item.wdf",1241680878,0x7003F174,nil,nil,20,1,3
	elseif 模型 == "强盗" then
		return "强盗","item.wdf",1241680878,0xD5C2566E,nil,nil,20,1,3
	elseif 模型 == "山贼" then
		return "山贼","item.wdf",1241680878,0x5F7346A8,nil,nil,20,1,3
	elseif 模型 == "树怪" then
		return "树怪","item.wdf",1241680878,0x4ED5C9C4,nil,nil,20,1,3
	elseif 模型 == "野猪" then
		return "野猪","item.wdf",1241680878,0xEF3A830D,nil,nil,20,1,3

	elseif 模型 == "进阶猫灵人形" then
	elseif 模型 == "野猪" then
	elseif 模型 == "野猪" then
	elseif 模型 == "野猪" then
	end
end


local function 取套装效果(tz)
	if tz == "盘丝阵" or tz == "定心术" or tz == "极度疯狂" or tz == "金刚护法" or tz == "逆鳞" or tz == "生命之泉" or tz == "魔王回首" or tz == "幽冥鬼眼" or tz == "楚楚可怜" or tz == "百毒不侵" or tz == "变身" or tz == "普渡众生" or
		tz == "炼气化神" or tz == "修罗隐身" or tz == "杀气诀" or tz == "一苇渡江" or tz == "碎星诀" or tz == "明光宝烛" then
		return "附加状态"
	elseif tz == "知己知彼" or tz == "似玉生香" or tz == "三味真火" or tz == "日月乾坤" or tz == "镇妖" or tz == "尸腐毒" or tz == "阎罗令" or tz == "百万神兵" or tz == "勾魂" or tz == "判官令" or tz == "雷击" or tz == "魔音摄魂" or tz == "摄魄" or tz == "紧箍咒" or
		tz == "落岩" or tz == "含情脉脉" or tz == "日光华" or tz == "水攻" or tz == "唧唧歪歪" or tz == "靛沧海" or tz == "烈火" or tz == "催眠符" or tz == "龙卷雨击" or tz == "巨岩破" or tz == "奔雷咒" or tz == "失心符" or tz == "龙腾" or tz == "苍茫树" or tz == "泰山压顶" or
		tz == "落魄符" or tz == "龙吟" or tz == "地裂火" or tz == "水漫金山" or tz == "定身符" or tz == "五雷咒" or tz == "后发制人" or tz == "地狱烈火" or tz == "满天花雨" or tz == "飞砂走石" or tz == "横扫千军" or tz == "落叶萧萧" or tz == "尘土刃" or tz == "荆棘舞" or tz == "冰川怒" or tz == "夺命咒" or tz == "浪涌" or tz == "裂石" then
		return "法术追加"
	end
end

function 内存类_物品:初始化()

end

function 内存类_物品:置对象(名称,打造,总类,根,允许)
	local 道具
	local c = false
	if typ(名称) == "table" then
		self.临时道具= 引擎.取物品(名称)
		self.介绍 = 道具[1]
		self.总类 = 道具[2]
		self.分类 = 道具[3]
		self.子类 = 道具[4]
		道具 = 名称
		self.名称 = 道具.名称
		c = true
		self.介绍 = 道具.介绍
		self.总类 = 道具.总类
		self.分类 = 道具.分类
		self.子类 = 道具.子类
		if  道具.总类 == 2 then
			self.等级 = 道具.等级
			self.角色限制 = 道具.角色限制
			self.性别限制 = 道具.性别限制
			self.等级 = 道具.等级
		end
		self.小模型 = 道具.小模型
		self.大模型 = 道具.大模型
		if 道具.阶品 ~= nil then
		    self.阶品 = 道具.阶品
		end
		if 道具.价格 ~= nil then
		    self.价格 = 道具.价格
		end
		if 道具.气血 ~= nil then
			self.气血 = 道具.气血
		end
		if 道具.魔法 ~= nil then
			self.魔法 = 道具.魔法
		end
	else
		道具 = 引擎.取物品(名称)
		self.介绍 = 道具[1]
		self.总类 = 道具[2]
		self.分类 = 道具[3]
		self.子类 = 道具[4]
		self.名称 = 名称
		if 道具[2] == 2 then
			self.等级 = 0
			if 道具[7] ~= nil then
				self.角色限制 = 道具[7]
			end
			if 道具[6] ~= nil then
				self.性别限制 = 道具[6]
			end
			if 道具[5] ~= nil then
				self.等级 = 道具[5]
			end
		end
		-- if 道具[3] == 10 and 道具[4] == 2 then--药品注释
		-- 	self.阶品 = 道具[8]
		-- end
		-- if 道具[2] == 1 then--药品注释
		-- 	self.阶品 = 30--道具[8]
		-- end
		if 道具[14] ~= nil then
			self.价格 = 道具[14]
		end
		if 道具[9] ~= nil then
			self.气血 = 道具[9]
		end
		if 道具[10] ~= nil then
			self.魔法 = 道具[10]
		end
	end
	self.资源 = 道具[11] self.小模型资源 = 道具[12] self.大模型资源 = 道具[13]
	if self.总类 == 2 and 允许==nil then
		if self.等级 == nil then
			self.等级 = 0
		end
		local lv = self.等级
		self.鉴定 = true
		self.五行 = 五行_[取随机数(1,5)]
		self.耐久 = 取随机数(500,700)
		self.价格 = 10000
		if 级别 ~= nil then
			self.等级 = 级别
		end
		if self.分类 <7 then
			self.开运孔数 = {当前=0,上限=0}
			if self.等级<30 then
			    self.开运孔数 = {当前=0,上限=1}
			elseif self.等级>=40 and self.等级<=60 then
			    self.开运孔数 = {当前=0,上限=2}
			elseif self.等级>=70 and self.等级<=90 then
			    self.开运孔数 = {当前=0,上限=3}
			elseif self.等级>=100 and self.等级<=120 then
			    self.开运孔数 = {当前=0,上限=4}
			elseif self.等级>=130 then
			    self.开运孔数 = {当前=0,上限=5}
			end
			self.熔炼效果={}
		end
	elseif self.总类 == 3 then
		if self.分类 == 1 then
			self.附带技能 = 打造
		end
	elseif self.总类 == 1 then
		if self.阶品 ~= 3 and self.分类 ~= 12  then
			self.可叠加 = true
		    --do
		else
		    self.可叠加 = false
		end
	elseif self.总类 == 4 then
		self.可叠加 = true
	elseif self.总类 == 5 then
		self.子类 = 打造
		if 总类 ~= nil then
			self.特效 = 总类
		end
		self.可叠加 = false
		if self.分类 == 4 then
			self.子类 = 道具[4]
			self.特效 = 道具[5]
			self.可叠加 = true
		elseif self.分类 == 6 then
			self.子类 = 道具[4]
			self.角色限制 = 道具[8]
			-- local lv=5

			-- self.等级 = 打造 or lv
			self.等级 = 打造 or lv
			self.特效 = 道具[9]
			if 道具[5] ~= nil then
				self.等级 = 道具[5]
			end
		end
	elseif  self.总类 == 6 then
		self.可叠加 = true
	elseif self.总类 == 7 then
		if self.分类 == 2 then
			self.可叠加 = true
		else
		    self.可叠加 = false
		end
	elseif  self.总类 == 9 then
		self.可叠加 = true
	elseif self.总类 == 10 then
		self.可叠加 = true
	elseif self.总类 == 11 then
		self.可叠加 = false
	elseif self.总类 == 12 then
		self.子类 = 打造
		self.可叠加 = false
	elseif self.总类 == 13 then
		self.子类 = 打造
		self.可叠加 = false
	elseif self.总类 == 100 then
		self.可叠加 = true
	elseif self.总类 == 103 then
		--self.可叠加 = true
	elseif self.总类 == 102 then
		self.可叠加 = true
	elseif self.总类 == 105 then
		self.可叠加 = true
	elseif self.总类 == 107 then
		self.可叠加 = true
	elseif self.总类 == 109 then
		self.可叠加 = true
	elseif self.总类 == 112 then
		local 临时五维 = {"体质","魔力","力量","耐力","敏捷"}
		self.气血 = 0
		self.装备坐骑 = 取坐骑装饰(道具[3])
		self.特技 = 临时五维[取随机数(1,#临时五维)]
		self.等级 = 0
		self.耐久=500
	elseif self.总类 == 151 then
		if self.分类 == 1 or self.分类 == 2 or self.分类 == 3 or self.分类 == 7 or self.分类 == 11 or self.分类 == 12 or self.分类 == 13 or self.分类 == 17 or self.分类 == 18 or self.分类 == 19 then
			self.可叠加 = true
		end
	elseif self.总类 == 200 then
		self.价格 = 5000
	elseif self.总类 == 207 then
		self.可叠加 = true
	elseif self.总类 == 20 or self.总类 == 25 or self.总类 == 8 then
		self.可叠加 = true
	elseif self.总类 == 101 and self.分类 == 3 and self.子类 >= 2 then
		self.可叠加 = true
	elseif self.总类 == 181 then
		self.可叠加 = true
	elseif self.总类 == 1000 then
		self.使用 = 道具[5]
		self.特技 = 道具[6]
		self.气血 = 0
		self.魔法 = 道具[3] * 50
		self.角色限制 = 道具[7] or 0
		self.五行 = 五行_[random(1,5)]
		self.伤害 = 道具[8] or 0
	elseif self.总类 == 1002 then
		self.使用 = 道具[5]
		self.特技 = 道具[6]
		self.效果 = 道具[15]
		self.魔法 = 道具[3] * 50
		self.气血 = 0
	elseif self.总类 == 21 then
		self.特效 = 道具[8]
		if self.分类 == 3 then
			self.可叠加 = false
		else
			self.可叠加 = true
		end
	elseif self.总类 == 30 then
		self.角色限制,self.资源,self.小模型资源,self.大模型资源,self.特技,self.特效,self.魔法,self.气血,self.伤害,self.小模型id = 变身卡(打造)
	end

end

function 取坐骑装饰(fl)
	local fhz = ""
	if fl == 1 then
		fhz = "宝贝葫芦"
	elseif fl == 2 then
		fhz = "神气小龟"
	elseif fl == 3 then
		fhz = "汗血宝马"
	elseif fl == 4 then
		fhz = "欢喜羊羊"
	elseif fl == 5 then
		fhz = "披甲战狼"
	elseif fl == 6 then
		fhz = "魔力斗兽"
	elseif fl == 7 then
		fhz = "闲云野鹤"
	elseif fl == 8 then
		fhz = "云魅仙鹿"
	end
	return fhz
end

function 绑定等级物品()
	local n = {}
	n[1] = {"红缨枪","曲尖枪","锯齿矛","乌金三叉戟","火焰枪","墨杆金钩","玄铁矛","金蛇信","丈八点钢矛","暗夜","梨花","霹雳","刑天之逆","五虎断魂","飞龙在天","天龙破城","弑皇"}
	n[2] = {"青铜斧","开山斧","双面斧","双弦钺","精钢禅钺","黄金钺","乌金鬼头镰","狂魔镰","恶龙之齿","破魄","肃魂","无敌","五丁开山","元神禁锢","护法灭魔","碧血干戚","裂天"}
	n[3] = {"青铜短剑","铁齿剑","吴越剑","青锋剑","龙泉剑","黄金剑","游龙剑","北斗七星剑","碧玉剑","鱼肠","倚天","湛卢","魏武青虹","灵犀神剑","四法青云","霜冷九州","擒龙"}
	n[4] = {"双短剑","镔铁双剑","龙凤双剑","竹节双剑","狼牙双剑","鱼骨双剑","赤焰双剑","墨玉双剑","梅花双剑","阴阳","月光双剑","灵蛇","金龙双剪","连理双树","祖龙对剑","紫电青霜","浮犀"}
	n[5] = {"五色缎带","幻彩银纱","金丝彩带","无极丝","天蚕丝带","云龙绸带","七彩罗刹","缚神绫","九天仙绫","彩虹","流云","碧波","秋水落霞","晃金仙绳","此最相思","揽月摘星","九霄"}
	n[6] = {"铁爪","天狼爪","幽冥鬼爪","青龙牙","勾魂爪","玄冰刺","青刚刺","华光刺","龙鳞刺","撕天","毒牙","胭脂","九阴勾魂","雪蚕之刺","贵霜之牙","忘川三途","离钩"}
	n[7] = {"折扇","铁骨扇","精钢扇","铁面扇","百折扇","劈水扇","神火扇","阴风扇","风云雷电","太极","玉龙","秋风","画龙点睛","秋水人家","逍遥江湖","浩气长舒","星瀚"}
	n[8] = {"细木棒","金丝魔棒","玉如意","点金棒","云龙棒","幽路引魂","满天星","水晶棒","日月光华","沧海","红莲","盘龙","降魔玉杵","青藤玉树","墨玉骷髅","丝萝乔木","醍醐"}
	n[9] = {"松木锤","镔铁锤","八棱金瓜","狼牙锤","烈焰锤","破甲战锤","震天锤","巨灵神锤","天崩地裂","八卦","鬼牙","雷神","混元金锤","九瓣莲花","鬼王蚀日","狂澜碎岳","碎寂"}
	n[10] = {"牛皮鞭","牛筋鞭","乌龙鞭","钢结鞭","蛇骨鞭","玉竹金铃","青藤柳叶鞭","雷鸣嗜血鞭","混元金钩","龙筋","百花","吹雪","游龙惊鸿","仙人指路","血之刺藤","牧云清歌","霜陨"}
	n[11] = {"黄铜圈","精钢日月圈","离情环","金刺轮","风火圈","赤炎环","蛇形月","子母双月","斜月狼牙","如意","乾坤","月光双环","别情离恨","金玉双环","九天金线","无关风月","朝夕"}
	n[12] = {"柳叶刀","苗刀","夜魔弯刀","金背大砍刀","雁翅刀","破天宝刀","狼牙刀","龙鳞宝刀","黑炎魔刀","冷月","屠龙","血刃","偃月青龙","晓风残月","斩妖泣血","业火三灾","鸣鸿"}
	n[13] = {"曲柳杖","红木杖","白椴杖","墨铁拐","玄铁牛角杖","鹰眼法杖","腾云杖","引魂杖","碧玺杖","业焰","玉辉","鹿鸣","庄周梦蝶","凤翼流珠","雪蟒霜寒","碧海潮生","弦月"}
	n[14] = {"硬木弓","铁胆弓","紫檀弓","宝雕长弓","錾金宝弓","玉腰弯弓","连珠神弓","游鱼戏珠","灵犀望月","非攻","幽篁","百鬼","冥火薄天","龙鸣寒水","太极流光","九霄风雷","若木"}
	n[15] = {"琉璃珠","水晶珠","珍宝珠","翡翠珠","莲华珠","夜灵珠","如意宝珠","沧海明珠","无量玉璧","离火","飞星","月华","回风舞雪","紫金葫芦","裂云啸日","云雷万里","赤明"}
	n[16] = {"钝铁重剑","桃印铁刃","赭石巨剑","壁玉长铗","青铜古剑","金错巨刃","惊涛雪","醉浮生","沉戟天戊","鸦九","昆吾","弦歌","墨骨枯麟","腾蛇郁刃","秋水澄流","百辟镇魂","长息"}
	n[18] = {"素纸灯","竹骨灯","红灯笼","鲤鱼灯","芙蓉花灯","如意宫灯","玲珑盏","玉兔盏","冰心盏","蟠龙","云鹤","风荷","金风玉露","凰火燎原","月露清愁","夭桃秾李","荒尘"}
	n[17] = {"油纸伞","红罗伞","紫竹伞","锦绣椎","幽兰帐","琳琅盖","孔雀羽","金刚伞","落梅伞","鬼骨","云梦","枕霞","碧火琉璃","雪羽穿云","月影星痕","浮生归梦","晴雪"}
	n[19] = {{"簪子","方巾"},{"玉钗","布帽"},{"梅花簪子","面具"},{"珍珠头带","纶巾"},{"凤头钗","缨络丝带"},{"媚狐头饰","羊角盔"},{"玉女发冠","水晶帽"},{"魔女发冠","乾坤帽"},{"七彩花环","黑魔冠"},{"凤翅金翎","白玉龙冠"},{"寒雉霜蚕","水晶夔帽"},{"曜月嵌星","翡翠曜冠"},{"郁金流苏簪","金丝黑玉冠"},{"玉翼附蝉翎","白玉琉璃冠"},{"鸾羽九凤冠","兽鬼珐琅面"},{"金珰紫焰冠","紫金磐龙冠"},{"乾元鸣凤冕","浑天玄火盔"}}
	n[20] = {"护身符","五色飞石","珍珠链",{"骷髅吊坠","苍魂珠"},{"江湖夜雨","九宫坠"},{"荧光坠子","高速之星"},{"风月宝链","八卦坠"},{"碧水青龙","鬼牙攫魂"},{"万里卷云","疾风之铃"},"七彩玲珑","黄玉琉佩","鸾飞凤舞","衔珠金凤佩","七璜珠玉佩","鎏金点翠佩","紫金碧玺佩","落霞陨星坠"}
	n[21] = {{"布裙","布衣"},{"丝绸长裙","皮衣"},{"五彩裙","鳞甲"},{"龙鳞羽衣","锁子甲"},{"天香披肩","紧身衣"},{"金缕羽衣","钢甲"},{"霓裳羽衣","夜魔披风"},{"流云素裙","龙骨甲"},{"七宝天衣","死亡斗篷"},{"飞天羽衣","神谕披风"},{"穰花翠裙","珊瑚玉衣"},{"金蚕丝裙","金蚕披风"},{"紫香金乌裙","乾坤护心甲"},{"碧霞彩云衣","蝉翼金丝甲"},{"金丝蝉翼衫","金丝鱼鳞甲"},{"五彩凤翅衣","紫金磐龙甲"},{"鎏金浣月衣","混元一气甲"}}
	n[22] = {"腰带","缎带","银腰带",{"水晶腰带","玉树腰带"},{"琥珀腰链","白面狼牙"},{"乱牙咬","魔童大牙"},{"攫魂铃","双魂引"},{"兽王腰带","百窜云"},{"八卦锻带","圣王坠"},"幻彩玉带","珠翠玉环","金蟾含珠","乾坤紫玉带","琉璃寒玉带","蝉翼鱼佩带","磐龙凤翔带","紫霄云芒带"}
	n[23] = {"布鞋","牛皮靴","马靴","侠客履","神行靴","绿靴","追星踏月","九州履","万里追云履","踏雪无痕","平步青云","追云逐电","乾坤天罡履","七星逐月靴","碧霞流云履","金丝逐日履","辟尘分光履"}
	n[24] = {"竹编护腕","皮腕","针腕","骨镯","青铜护腕","玛瑙护腕","琉璃护腕","镂空银镯","笼玉镯","嵌宝金腕","玳瑁护腕","七星宝腕","缚龙筋","凤翎护腕","织锦彩带","冰蚕丝带"}
	n[25] = {"竹编脖环","钢圈","荆棘环","骨环","青铜颈环","玛瑙石环","琉璃环","九曲环","笼玉环","嵌宝金环","玳瑁环","七星宝环","缚龙圈","鸾尾环","织锦颈圈","冰蚕丝圈"}
	n[26] = {"竹藤甲","皮甲","刺甲","骨排甲","青铜披甲","玛瑙软甲","琉璃罩甲","连环铠甲","笼玉甲","嵌宝金甲","玳瑁衣","七星宝甲","缚龙甲","凤凰彩衣","织锦软褡","冰蚕织甲"}
	return n
end

return 内存类_物品